package com.mengshu.platform.web.resp;

import com.mengshu.platform.po.AdminUserPO;
import com.mengshu.token.api.PermissionLoginUser;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Set;

/**
 * <p>
 *     平台登录用户
 * </p>
 *
 * @author liuning
 * @date 10:01 上午 2022/2/5
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PlatformLoginUser implements PermissionLoginUser {

    private Long id;

    private String name;

    private Set<String> permissions;

    public PlatformLoginUser(AdminUserPO user, Set<String> permissions) {
        this.id = user.getId();
        this.name = user.getName();
        this.permissions = permissions;
    }
}
